import request from '@/utils/request'

const api = {
  rankList: '/t1/point/rank_list',
  getRule: '/t1/point/get_rule',
  setRule: '/t1/point/set_rule',
  seasonCount: '/t1/point/season_count',
  familyPointDetail: '/t1/point/family_point_detail',
  rankInfo: '/t1/point/rank_info',
  lists: '/t1/point/lists',
  showCancel: '/t1/point/show_cancel',
  reject: '/t1/point/reject'
}

/**
 * login func
 * parameter: {
 *     username: '',
 *     password: '',
 *     remember_me: true,
 *     captcha: '12345'
 * }
 * @param parameter
 * @returns {*}
 */
// 获取积分列表
export function rankList (parameter) {
  return request({
    url: api.rankList,
    method: 'get',
    params: parameter
  })
}

// 获取积分规则
export function getRule () {
  return request({
    url: api.getRule,
    method: 'get'
  })
}

// 设置积分规则
export function setRule (parameter) {
  return request({
    url: api.setRule,
    method: 'post',
    data: parameter
  })
}

// 季度汇总
export function seasonCount (parameter) {
  return request({
    url: api.seasonCount,
    method: 'get',
    params: parameter
  })
}

// 家庭积分明细详情
export function familyPointDetail (parameter) {
  return request({
    url: api.familyPointDetail,
    method: 'get',
    params: parameter
  })
}

// 家庭积分明细详情
export function rankInfo (parameter) {
  return request({
    url: api.rankInfo,
    method: 'get',
    params: parameter
  })
}

// 积分管理列表
export function lists (parameter) {
  return request({
    url: api.lists,
    method: 'get',
    params: parameter
  })
}

// 季度总汇展示/取消

export function showCancel (parameter) {
  return request({
    url: api.showCancel,
    method: 'post',
    data: parameter
  })
}

// 积分管理，驳回
export function reject (parameter) {
  return request({
    url: api.reject,
    method: 'post',
    data: parameter
  })
}
